package com.sgl.blog.service.impl;

import com.sgl.blog.mapper.TypeMapper;
import com.sgl.blog.pojo.BlogType;
import com.sgl.blog.service.TypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @标题： TypeService
 * @内容：
 * @作者： 宋志豪
 */
@Service
public class TypeServiceImpl implements TypeService {
    @Resource
    private TypeMapper typeMapper;

    @Override
    public List<BlogType> findAll() {
        return typeMapper.selectAll();
    }

    @Override
    public List<BlogType> findByBaseID(Integer baseId) {
        BlogType blogType = new BlogType();
        blogType.setTypeBase(baseId);
        return typeMapper.select(blogType);
    }

    @Override
    public BlogType findById(Integer id) {
        return typeMapper.selectByPrimaryKey(id);
    }
}
